/**
 * Definition for singly-linked list.
 * function ListNode(val, next) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.next = (next===undefined ? null : next)
 * }
 */
/**
 * @param {ListNode} head
 * @return {ListNode}
 */
 var swapPairs = function(head) {
  let ret = new ListNode(1,head)
  let cur = ret
  while(cur.next && cur.next.next){
    let temp = cur.next
    let tempT = cur.next.next
    let tempTT = tempT.next
    cur.next = tempT
    tempT.next = temp
    temp.next = tempTT
    cur = temp
    
  }
  return ret.next
};